#include<stdio.h>
#define maxn 10
double f(int n,double a[],double x);
int main(){
	int n,i;
	double a[maxn];
	double x;
	scanf("%d %lf",&n,&x);
	for(i=0;i<=n;i++){
		scanf("%lf",&a[i]);
	}
	printf("%.1f\n",f(n,a,x));
	return 0;
} 
double f(int n,double a[],double x){
	double fx=0,temp=1.0;
	int i;
	for(i=0;i<=n;i++){
        
		fx+=(a[i]*temp);
		temp*=x;
	}
	return fx;
}
